classification_example <- function(X, y, seed, kernel_type = "rbf",
                                   path = "", file_name = "file",
                                   sample_seed = 1234,
                                   max.steps = 400000) {
  y <- generate_character_label(y)
  C <- 2^seq(-8, 8, 1)
  if (kernel_type == "linear") {
    gamma <- 1
  } else {
    gamma <- 2^seq(-4, 4, 1)
  }
  
  cccp.steps <- 20
  hq.steps   <- 20
  irls.steps <- 20
  
  eps.cccp   <- 1e-5
  eps.hq     <- 1e-5
  eps.irls   <- 1e-5
  eps        <- 1e-10
  
  # BLS-BSH-TSVM
  
  lambda_bls_bsh <- 2^seq(-6, 6, 2) 
  
  # CL2p-LS-TSVM
  epsilon_cl2p <- c(0.1, 0.2, 0.5, 1, 2)
  p_cl2p <- c(0.5, 1, 1.5, 2)
  
  # Closs-TBSVM
  sigma_closs <- c(0.5, 0.7, 0.9, 1, 2)
  lambda_closs <-  C
  gamma_closs <- 1e-7
  
  res_df <- as.data.frame(matrix(0, 6, 5))
  metrics <- list("acc" = accuracy, "f1score" = binaryf1score)
  num_metrics <- length(metrics)
  
  colnames(res_df) <- c("model", "acc", "f1score",
                        "acc - sd", "f1score - sd")
  
  res_df$model <- c("Hinge-TSVM", "SHinge-TSVM", "LS-TSVM",
                    "CL2p-LS-TSVM", "C-TBSVM", "BLS-BSH-TSVM")
  preprocessing_pip <- list(standar_scaler)
  
  #-----------------------------------------------------------------------------
  param_list <- list("C1" = C,
                     "gamma" = gamma)
  model_settings <- list(max.steps = max.steps, eps = eps, kernel = kernel_type)
  res1 <- grid_search_cv(SupportVectorLab::hinge_tsvm, X, y, 5, metrics = metrics,
                         param_list = param_list,
                         seed = seed,
                         model_settings = model_settings,
                         pipeline = preprocessing_pip)
  print("Hinge-TSVM")
  print(res1)
  #-----------------------------------------------------------------------------
  param_list <- list("C1" = C,
                     "gamma" = gamma)
  model_settings <- list(max.steps = max.steps, eps = eps, kernel = kernel_type)
  res2 <- grid_search_cv(SupportVectorLab::sh_tsvm, X, y, 5, metrics = metrics,
                         param_list = param_list,
                         seed = seed,
                         model_settings = model_settings,
                         pipeline = preprocessing_pip)
  print("SHinge-TSVM")
  print(res2)
  #-----------------------------------------------------------------------------
  param_list <- list("C1" = C,
                     "gamma" = gamma)
  model_settings <- list(kernel = kernel_type)
  res3 <- grid_search_cv(ls_tsvm, X, y, 5, metrics = metrics,
                         param_list = param_list,
                         seed = seed,
                         model_settings = model_settings,
                         pipeline = preprocessing_pip)
  print("LS-TSVM")
  print(res3)
  #-----------------------------------------------------------------------------
  param_list <- list("C1" = C,
                     "gamma" = gamma,
                     "epsilon1" = epsilon_cl2p)
  model_settings <- list(irls.steps = irls.steps,
                         eps.irls = eps.irls, 
                         kernel = kernel_type)
  res4 <- grid_search_cv(cL2p_ls_tsvm, X, y, 5, metrics = metrics,
                         param_list = param_list,
                         seed = seed,
                         model_settings = model_settings,
                         pipeline = preprocessing_pip)
  print("CL2p-LS-TSVM")
  print(res4)
  #-----------------------------------------------------------------------------
  param_list <- list("gamma" = gamma,
                     "lambda1" = lambda_closs,
                     "sigma1" = sigma_closs,
                     "gamma1" = gamma_closs)
  model_settings <- list(hq.steps = hq.steps, eps.hq = eps.hq,
                         kernel = kernel_type)
  res5 <- grid_search_cv(closs_tbsvm, X, y, 5, metrics = metrics,
                         param_list = param_list,
                         seed = seed,
                         model_settings = model_settings,
                         pipeline = preprocessing_pip)
  print("Closs-TBSVM")
  print(res5)
  #-----------------------------------------------------------------------------
  param_list <- list("C1" = C,
                     "gamma" = gamma,
                     "lambda1" = lambda_bls_bsh)
  model_settings <- list(max.steps = max.steps, eps = eps,
                         cccp.steps = cccp.steps, eps.cccp = eps.cccp,
                         kernel = kernel_type)
  res6 <- grid_search_cv(bls_bsh_tsvm, X, y, 5, metrics = metrics,
                         param_list = param_list,
                         seed = seed,
                         model_settings = model_settings,
                         pipeline = preprocessing_pip)
  print("BLS-BSH-TSVM")
  print(res6)
  #-----------------------------------------------------------------------------
  res_all <- list(res1, res2, res3, res4, res5, res6)
  for (j in 1:length(res_all)) {
    for (i in 1:length(metrics)) {
      res <- res_all[[j]]
      mean_metric <- res$results[res$idx_max[i], i]
      sd_metric <- res$results[res$idx_max[i], num_metrics + i]
      res_df[j, i + 1] <- mean_metric
      res_df[j, i + 1 + num_metrics] <- sd_metric
    }
  }
  # res_df <- cbind(res_df, file_name)
  file_name <- paste(kernel_type, file_name, sep = "_")
  file_name <- paste(path, file_name, sep = "")
  file_name <- paste(file_name, ".csv", sep = "")
  write.csv(res_df, file = file_name, row.names = F)
}
